package com.pithypan.mapper;

import com.pithypan.entity.FileInfo;
import com.pithypan.entity.FileShare;
import com.pithypan.vo.FileInfoQuery;
import com.pithypan.vo.FileShareQuery;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;

@Repository
public interface FileShareMapper {

    //根据条件查询总记录数
    public Integer findTotalCount(@Param("query") FileShareQuery query);

    //根据条件分页查询结果集
    public ArrayList<FileShare> findListByPage(@Param("query")FileShareQuery query);

    //添加分享文件
    public void insert(FileShare share);

    //删除分享了的文件
    public Integer deleteFileShareBatch(@Param("shareIdArray") String[] shareIdArray, @Param("userId") String userId);

    //根据id查询分享文件
    public FileShare findFileShareByShareId(String shareId);

    //浏览次数+1
    public void updateShareShowCount(@Param("shareId") String shareId);
}
